<template>
  <el-dialog title="批示" :visible.sync="dialogVisible" :close-on-click-modal="false" width="50%" top="50px" custom-class="historyDialog">
    <div class="history-container">
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="批示内容">
          <el-input v-model="form.remarks" type="textarea" :rows="4" placeholder="请输入批示内容" />
        </el-form-item>
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="onSubmit">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { doComment } from '@/api/newBaqsj/newBaqsj'
export default {
  data() {
    return {
      dialogVisible: false,
      form: {
        id: 0,
        remarks: ''
      }
    }
  },
  methods: {
    open(row) {
      this.form.id = row.id
      this.dialogVisible = true
    },
    onSubmit() {
      doComment(this.form).then(response => {
        this.$message({
          message: '批示成功',
          type: 'success'
        })
        this.dialogVisible = false
        this.$emit('getList')
      })
    }
  }
}
</script>
